import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-oem/oem/wallet/user_wallet/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/rb-oem/oem/wallet/user_wallet/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const userNoTypelist = () => {
  return request({
    url: '/api/rb-oem/oem/serviceInfo/service_info/list',
    method: 'get',
    params: {
      current:'-1',
      size:'-1',
      serviceAuditStatus:2
    }
  })
}

// 钱包--清零或划转
export const balanceRecordChange = (param) => {
  return request({
    url: '/api/rb-oem/oem/balancerecord/balance_record/balanceRecordChange',
    method: 'post',
    data:{
      ...param
    }
  })
}


// ---------------目前用不到 api  star--------------------------
export const remove = (ids) => {
  return request({
    url: '/api/rb-oem/oem/wallet/user_wallet/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/rb-oem/oem/wallet/user_wallet/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/rb-oem/oem/wallet/user_wallet/submit',
    method: 'post',
    data: row
  })
}


/* 仓库 导出 */
export const getExport = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-oem/oem/wallet/user_wallet/export',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getListCount = (params) => {
  return request({
    url: '/api/rb-oem/oem/wallet/user_wallet/statistics',
    method: 'get',
    params: {
      ...params
    }
  })
}

/* 配置余额 */
export const addAmount = (row) => {
  return request({
    url: '/api/rb-oem/oem/wallet/user_wallet/add',
    method: 'post',
    data: row
  })
}

/* 导出模板 */
export const getExportTemplate = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-oem/oem/wallet/user_wallet/export-template',
    method: 'get',
    params: {
      ...params,
    }
  })
}